  
#import "RootTabBarController.h"
#import "HomePageViewController.h"
#import "MapViewController.h"
#import "MyselfViewController.h"
#import "ChatTableViewController.h"


@interface RootTabBarController ()

@end

@implementation RootTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self addViewController];
    
    // Do any additional setup after loading the view.
}

// 添加视图
- (void)addViewController{
    

    
    /**
     首页
     */
    HomePageViewController *homePageVC = [[HomePageViewController alloc]init];
//    UINavigationController *homePageNC = [[UINavigationController alloc]initWithRootViewController:homePageVC];
    homePageVC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"首页" image:[UIImage imageNamed:@"0"] tag:101];

    /**
     地图
     */
    MapViewController *mapVC = [[MapViewController alloc]init];
    UINavigationController *mapNC = [[UINavigationController alloc]initWithRootViewController:mapVC];
    mapNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"地图" image:[UIImage imageNamed:@"1"] tag:102];
    
    /**
     聊天
     */
    ChatTableViewController *chatTVC = [[ChatTableViewController alloc]init];
    UINavigationController *chatTNC = [[UINavigationController alloc]initWithRootViewController:chatTVC];
    chatTNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"聊天" image:[UIImage imageNamed:@"2"] tag:103];
    
    
    MyselfViewController *myselfVC = [[MyselfViewController alloc]init];
    UINavigationController *myselfNC = [[UINavigationController alloc]initWithRootViewController:myselfVC];
    myselfNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"我的" image:[UIImage imageNamed:@"3"] tag:104];
    

    // 集成
    self.viewControllers = @[homePageVC,mapNC,chatTNC,myselfNC];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
